﻿<navigation:Page x:Class="Candy.UpdatePage" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
                 xmlns:ia="http://schemas.microsoft.com/expression/2010/interactivity"
                 xmlns:gala="http://www.galasoft.ch/mvvmlight"
           d:DesignWidth="812.417" d:DesignHeight="817.384"
           Title="UpdatePage Page" DataContext="{Binding Update, Mode=OneWay, Source={StaticResource Locator}}"
                 
                 >
    <ia:Interaction.Triggers>
        <ia:EventTrigger EventName="Loaded">
            <gala:EventToCommand Command="{Binding CheckForUpdate, Mode=OneWay}"/>
        </ia:EventTrigger>
    </ia:Interaction.Triggers>
    
    <Grid x:Name="LayoutRoot" Background="{StaticResource ControlBackground}">
        <Grid.RowDefinitions>
            <RowDefinition Height="147"/>
            <RowDefinition Height="Auto" MinHeight="0"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Margin="320,0,320,29" Grid.Row="3" TextAlignment="Center" TextWrapping="Wrap" FontSize="21.333" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding UpdateAvailable, Converter={StaticResource VisibilityConverter}}" Grid.RowSpan="2"/>
        <StackPanel Margin="198,0,197,9" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Grid.RowSpan="1">
            <TextBlock HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap" Text="Cand" VerticalAlignment="Center" FontSize="85.333" FontWeight="Bold" FontFamily="Segoe UI Semibold"/>
            <Image Margin="2,43,0,0" VerticalAlignment="Center" Source="Images/Candy64.png" Stretch="None" HorizontalAlignment="Center"/>
        </StackPanel>
        <ProgressBar HorizontalAlignment="Center" Margin="170,0" Grid.Row="2" VerticalAlignment="Center" Width="300" IsIndeterminate="True" Visibility="{Binding IsBusy, Converter={StaticResource VisibilityConverter}}"/>
        <TextBlock Margin="0" Grid.Row="4" TextAlignment="Center" TextWrapping="Wrap" FontSize="21.333" VerticalAlignment="Center" HorizontalAlignment="Center" Text="...checking for update" Visibility="{Binding IsBusy, Converter={StaticResource VisibilityConverter}}"/>
        <TextBlock Margin="0" Grid.Row="5" TextAlignment="Center" TextWrapping="Wrap" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="{Binding UpdateAvailable, Converter={StaticResource VisibilityConverter}}">
        	<Run Text="Candy got updated. See details below."/>
        	<LineBreak/>
        	<Run Text="In order to use the new version you have to close Candy at launch it again."/>
        </TextBlock>
        <TextBox HorizontalAlignment="Center" Margin="0,10" Grid.Row="6" TextWrapping="Wrap" Text="{Binding ReleasNotes}" Width="500" Visibility="{Binding UpdateAvailable, Converter={StaticResource VisibilityConverter}}" IsReadOnly="True" BorderBrush="{StaticResource Border}" BorderThickness="1"/>
    </Grid>
</navigation:Page>
